home *** CD-ROM | disk | FTP | other *** search
/ NOVA - For the NeXT Workstation / NOVA - For the NeXT Workstation.iso / SourceCode / OOP_Course / Examples / Line / LineView.m < prev    next >
Text File  |  1992-12-19  |  479b  |  27 lines

  1. #import "LineView.h"
  2.  
  3. @implementation LineView
  4.  
  5. - takeSliderInput:sender
  6. {
  7.     xSlider    = [sender floatValue];
  8.     [self display];    
  9.     return self;
  10. }
  11.  
  12.  
  13. - drawSelf:(const NXRect*)r :(int)c
  14. {
  15.     PSsetgray(NX_WHITE);
  16.     NXRectFill(&bounds);    //erase the present view
  17.     PSsetgray(NX_BLACK);
  18.     PSsetlinewidth(5.0);
  19.     PSnewpath();
  20.       PSmoveto(bounds.size.width/2.0, 10.0);
  21.       PSlineto(xSlider*bounds.size.width, bounds.size.height - 10.0);
  22.     PSstroke();
  23.     return self;
  24. }
  25.  
  26. @end
  27.